Skip to content

feat(go): add TransformationOptions for ingestion transporter configuration#6293

Open
MarioAlexandruDan wants to merge 35 commits into
mainfrom
feat/go-transformation-options
Open

feat(go): add TransformationOptions for ingestion transporter configuration#6293
MarioAlexandruDan wants to merge 35 commits into
mainfrom
feat/go-transformation-options

Conversation

@MarioAlexandruDan
Copy link
Copy Markdown
Contributor

@MarioAlexandruDan MarioAlexandruDan commented Apr 24, 2026

🧭 What and Why

Part of the effort to standardize transformationOptions across all 11 language SDKs. Depends on the JS + Foundation ticket for CTS infrastructure.

🎟 JIRA Ticket API-374:

Changes included:

  • TransformationOptions fields are flat: Go has no general-purpose ClientOptions primitive, so duplicating 6 fields directly avoids a single-use wrapper.
  • ClientOption func(SearchConfiguration) functional option: Go's idiomatic way to pass optional construction-time config; WithTransformationOptions(opts) fits naturally alongside other future With options.
  • SetTransformationOptions also exposed as a method: Lets callers configure after construction without rebuilding the client, consistent with SetClientApiKey.
  • DefaultHeader direct assignment, not merge: In Go, auth headers are injected per-request from cfg.AppID/cfg.ApiKey, not stored in DefaultHeader, so replacing it doesn't wipe credentials.
  • transformation_options.mustache registered only for search client: Only the search client needs the transporter helpers; conditional registration avoids generating a useless file for every other client.

🧪 Test

@algolia-bot
Copy link
Copy Markdown
Collaborator

algolia-bot commented Apr 24, 2026

✔️ Code generated!

Name Link
🪓 Triggered by 2c5786b65a77078366b19dc3301d5b06889b456c
🍃 Generated commit c934a1e124b763795f479db1b61b1d4f7bce566d
🌲 Generated branch generated/feat/go-transformation-options
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 2380
go 2166
php 1743
csharp 1538
python 1360
java 1146
ruby 1044
swift 330
scala 23

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 24 complexity

Metric Results
Complexity 24

View in Codacy

TIP This summary will be updated as you push new changes.

@MarioAlexandruDan MarioAlexandruDan self-assigned this Apr 24, 2026
MarioAlexandruDan and others added 4 commits April 24, 2026 16:56
- Update generated configuration.go: replace TransformationConfiguration
  with TransformationOptions, deprecate config-level SetTransformationRegion
- Update generated client.go: add opts ...ClientOption to NewClient,
  fix NewClientWithConfig to use SetTransformationOptions (no host leak),
  add SetTransformationOptions and deprecated SetTransformationRegion on client
- Update generated search_test.go: three *WithTransformation CTS tests now
  use SetTransformationOptions with explicit ingestion hosts
- Move hand-written tests from tests/client/ to tests/manual/ (correct
  package picked up by runCts.ts manual runner), add more test coverage
- Fix generation.config.mjs: drop stale client-specific exclusion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from a16159f to 8218d07 Compare April 27, 2026 12:16
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from 8218d07 to 3922821 Compare April 27, 2026 12:20
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from 3922821 to a00567b Compare April 27, 2026 12:31
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review April 29, 2026 13:03
@MarioAlexandruDan MarioAlexandruDan requested a review from a team as a code owner April 29, 2026 13:03
Comment thread templates/go/configuration.mustache Outdated
Comment thread tests/output/go/tests/manual/transformation_options_test.go
@MarioAlexandruDan MarioAlexandruDan marked this pull request as draft May 11, 2026 12:52
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 11, 2026 14:01
Comment thread templates/go/client.mustache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants